package com.mes.cloud.rabbit.bean;

import java.io.Serializable;
import java.sql.Timestamp;

/**
 * Message
 *
 * @Author:WenJun Fan
 * @Date: 2018/6/14
 */

public class Message implements Serializable{
    private static final long serialVersionUID = 1L;

    //消息处理标识符
    private String id;

    //消息内容
    private Object content;

    //消息发送人ID
    private String userId;

    //消息发送人名字
    private String userName;

    //消息的发送时间
    private Timestamp sendDate;

    public Message() {
        if(sendDate == null){
            sendDate = new Timestamp(System.currentTimeMillis());
        }
    }

    private Message(String id, Object content, String userId, String userName, Timestamp sendDate) {
        this.id = id;
        this.content = content;
        this.userId = userId;
        this.userName = userName;
        this.sendDate = sendDate;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Object getContent() {
        return content;
    }

    public void setContent(Object content) {
        this.content = content;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public Timestamp getSendDate() {
        return sendDate;
    }

    public void setSendDate(Timestamp sendDate) {
        this.sendDate = sendDate;
    }

    @Override
    public String toString() {
        return "Message{" +
                "id='" + id + '\'' +
                ", content=" + content +
                ", userId=" + userId +
                ", userName='" + userName + '\'' +
                ", sendDate=" + sendDate +
                '}';
    }
}
